<template>
  <div class="noticeDialog">
    <div class="noticeDialog-title">
      <span v-if="checkStatus">回答正确</span>
      <span v-else>回答错误</span>
    </div>
    <div class="noticeDialog-body">
      <span class="noticeDialog-body__score" v-if="checkStatus"
        >这周已获得{{ gameScore }}分</span
      >
      <span class="noticeDialog-body__score" v-else>请继续加油</span>
      <img
        class="noticeDialog-body__noticeIcon"
        :src="
          checkStatus
            ? require('@/assets/right.png')
            : require('@/assets/wrong.png')
        "
        alt="提示图标"
      />
      <button class="noticeDialog-body__nextBtn" @click="toNext">
        继续答题
      </button>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    gameScore: {
      type: Number,
      default: 0,
    },
    checkStatus: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    toNext() {
      this.$emit("to-next");
    },
  },
};
</script>

<style lang="less" scoped>
.noticeDialog {
  transition: all 1s;
  position: absolute;
  top: 35%;
  left: calc((100% - 250px) / 2);
  width: 250px;
  height: 220px;
  z-index: 999;

  display: flex;
  flex-direction: column;
  .noticeDialog-title {
    flex: 1;

    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #2c90e5;
  }
  .noticeDialog-body {
    flex: 4;

    display: flex;
    flex-direction: column;
    border-radius: 0 0 20px 20px;
    background-color: white;
    .noticeDialog-body__score {
      flex: 0.5;

      display: flex;
      justify-content: center;
      align-items: center;
      color: #aaaeac;
      font-size: 15px;
    }
    .noticeDialog-body__noticeIcon {
      width: 70px;
      height: 70px;
      position: relative;
      left: 35%;
    }
    .noticeDialog-body__nextBtn {
      position: relative;
      left: 26%;
      top: 15px;
      width: 45%;
      background-color: #2c90e4;
      border: none;
      padding: 5px;
      color: white;
    }
  }
}
</style>